<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>时间操作</title>
    <link rel="stylesheet" href="style.css">
    <script src="jQuery/jquery-3.3.1.min.js"></script>
</head>
<body>
<div class="input">
    <input type="text " id="input1" value="2018-06-15 11:23:39">
    <span class="input-btn" id="btn1">转换时间戳</span>
    <input type="text " id="input1-1">
</div>
<div class="input">
    <input type="text " id="input2" value="1529033019000">
    <span class="input-btn" id="btn2">转换时间</span>
    <input type="text " id="input2-1">
</div>
<div class="input">
    <input type="text " id="input3" value="2018/12/12 23:59:59">
    <span class="input-btn" id="btn3">倒计时</span>
    <input type="text " id="input3-1">
</div>
<div class="input">
    <input type="text " id="input4" value="123456789">
    <span class="input-btn" id="btn4">转汉字</span>
    <input type="text " id="input4-1">
</div>
<script src="datatime.js"></script>
<script>
    $("#btn1").click(function () {
        $("#input1-1").val(DateToUnix($("#input1").val()));
    });
    $("#btn2").click(function () {
        $("#input2-1").val(UnixToDate(Number($("#input2").val()),2));
    });
    $("#btn3").click(function () {
        setInterval(function () {
            $("#input3-1").val(DownTime($("#input3").val()));
        },1000);
    });
    $("#btn4").click(function () {
        $("#input4-1").val(NumBerToHanZi($("#input4").val()));
    });
</script>
</body>
</html>